﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class Cargo_list : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            this.bind();
        }
    }
    public void bind()
    {
        SqlConnection strcon = Class1.DBconnection();
        strcon.Open();
        SqlDataAdapter sda = new SqlDataAdapter("select * from tb_Cargo where Auditing=1 order by id desc", strcon);
        DataSet ds = new DataSet();
        sda.Fill(ds,"tb_Cargo");
        this.GridView1.DataSource = ds.Tables["tb_Cargo"];
        this.GridView1.DataBind();
    }
    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        this.GridView1.PageIndex = e.NewPageIndex;
        this.bind();
    }

}
